<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>列表</title>

<style type="text/css" style="display: none;">
.hover {
	background-color: red;
}
.hover-green {
	background-color: green;
}
</style>

<script type="text/javascript">
check = function()
{
	var url = "<%=request.getContextPath()%>/cmtm/get/check/";
	var checked_ids = new Array();
	var comment_ids = document.getElementsByName("id4commentlist");
	for(i=0;i<comment_ids.length;i++)
		if(comment_ids[i].checked)
			checked_ids.push(comment_ids[i].value);
	if(checked_ids==null||checked_ids.length==0)
	{
		alert("请选择要审核的留言！");
		return ;
	}
	if(checked_ids!=null&&checked_ids.length>1)
	{
		alert("每次只能审核一条留言！");
		return;
	}
	url=  url+checked_ids[0];
	location.href=url;
	
}

//遍历table根据表中的内容显示不同的颜色
$(document).ready(function(){
	
	$('.data_table_list').find('tr').each(function(){
		
	 	$(this).find('td').each(function(i){
	    	//如果是否通过审核字段内容是“否”，侧将改变背景颜色为红色
	 		if((i==6 || i==7 || i==8 || i==9) && $(this).text().trim()=='否'){
	    	
	    		$(this).css('color', '#FF0000');
	    		$(this).css('font-weight', 'bolder');
	    	}
	    });
		
	});
	
});

</script>
</head>
<body>
<div class="youarehere">网站内容管理 &gt; <span>管理留言</span></div>
<div id="content">
<form action='<chtml:path path="/" />cmtm/list' method="post" id="commentForm">
<input type="hidden" id="isHidden" name="isHidden" value="${isHidden}" />
<table width="99%" align="center" border="0" cellpadding="1"
	cellspacing="1" class="data_table">
	<tr>
		<td class="data_tab_th" colspan="8">查询留言</td>
	</tr>
	<tr>
		<td class="data_tab_tdr">标题</td>
		<td class="data_tab_tdl"><input type="text" value="${title}" name="title" /></td>
		<%--
		<td class="data_tab_tdr">留言类型:</td>
		<td class="data_tab_tdl"><chtml:enum name="commentType" defaultOption="--请选择--" defaultValue=""
			selected="${requestScope.commentType}" textProperty="text"
			type="com.hengpeng.itfinbase.persist.Comment$CommentType" />
		</td>
		 --%>
		<td class="data_tab_tdr">是否审核</td>
		<td class="data_tab_tdl">
			<chtml:enum name="auditState" defaultOption="--请选择--" defaultValue=""
				selected="${auditState}" textProperty="text"
				type="com.hengpeng.common.persist.entity.AbstractEntity$BoolValue" />
		</td>
		<td class="data_tab_tdr">回复状态</td>
		<td class="data_tab_tdl">
			<chtml:enum name="replyState" defaultOption="--请选择--" defaultValue=""
				selected="${replyState}" textProperty="text"
				type="com.hengpeng.common.persist.entity.AbstractEntity$BoolValue" />
		</td>
	</tr>
	<tr>
		<td class="data_tab_tdr">留言内容</td>
		<td class="data_tab_tdl"><input type="text" value="${content}" name="content" /></td>
		<td class="data_tab_tdr">回复内容</td>
		<td class="data_tab_tdl"><input type="text" value="${reply}" name="reply" /></td>
		<td class="data_tab_tdr">留言人</td>
		<td class="data_tab_tdl"><input type="text" value="${commUserName}" name="commUserName" /></td>
		<td class="data_tab_tdr">回复人</td>
		<td class="data_tab_tdl"><input type="text" value="${replyUserName}" name="replyUserName" /></td>
	</tr>
	<tr>
		<td align="center" colspan="8" class="bg_bai">
		
		<div class="mr_20 t_c">
			<input type="submit" class="pub_bt" value="查询" onclick='document.getElementById("isHidden").value="NO";document.getElementsByName("PaginationButton_CurrentPage4commentlist")[0].value=1;'/>
			<input type="submit" class="pub_bt" value="查询屏蔽" onclick='document.getElementById("isHidden").value="YES";document.getElementsByName("PaginationButton_CurrentPage4commentlist")[0].value=1;'/>
			<input type="button" class="pub_bt" value="重置" onclick="this.form.reset();" />
		</div>
		
	    </td>
	</tr>
</table>
<br />
<!-- 自定义标签示例 --> 
<chtml:list collection="commentlist"
	type="com.hengpeng.itfinoss.controller.vo.CommentVo" linkTarget="_self"
	includeFields="title,commentType,postTime,commUserName,auditState,replyState,isHidden,isPublic" fieldWidth="10%,45%,10%,10%,5%,5%,5%,5%,5%" 
	showCheckBox="true" title="留言信息列表" paginationName="commentListPage"
	allowSort="false" detailLink="get/@{id}"  showLinkField="title">
	<input type="button" value="删除" onclick="javascript:helper.fun.deleted('<%=request.getContextPath()%>/cmtm/remove','ids','id4commentlist','commentForm');" />
</chtml:list></form>
</div>
<!--说明   -->	
<div class="sm_info">
	<p class="row_one">说明：</p>
	<p class="other"></p>
	<p class="other"></p>
</div>
</body>
</html>

